Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 8 - TCP/IP Services / TCP/IP Services Reference
Functions / Resolving Internet Addresses


OTInetStringToAddress

Resolves a domain name to its equivalent internet addresses.

C INTERFACE
OSStatus OTInetStringToAddress (InetSvcRef ref,
                                char *name,
                                InetHostInfo *hinfo);
C++ INTERFACE
OSStatus TInternetServices::StringToAddress (char *name,
                                             InetHostInfo *hinfo);
PARAMETERS
ref
The internet services reference you obtained when you opened the TCP/IP service provider.
name
A pointer to the domain name you want to resolve. This can be a host name, a partially qualified domain name, a fully qualified domain name, or an internet address in dotted-decimal format.
hinfo
A pointer to an InetHostInfo structure that you provide. When the function completes, it places the canonical name and up to ten associated IP addresses in this structure. If the function finds less than ten IP addresses, it fills in the rest of the address array with zeros.
DESCRIPTION
Because the architecture of Open Transport TCP/IP provides for multihoming, a single host can be associated with multiple internet addresses. You can use the OTInetStringToAddress function to return multiple addresses for multihomed hosts.

Note
Because multihoming has not been implemented
in the initial release of Open Transport, the OTInetStringToAddress function never returns
more than one address.
If you specify an internet address in dotted-decimal format for the hinfo parameter, the OTInetStringToAddress function places that address in the InetHostInfo.name field instead of a canonical name.

If you call the OTInetStringToAddress function asynchronously, the TCP/IP service provider calls your notifier function with the T_DNRSTRINGTOADDRCOMPLETE completion event code when the function completes. The cookie parameter to the notifier function contains the pointer you specified in the hinfo parameter. If you had more than one simultaneous outstanding call to the OTInetStringToAddress function, you can use this information to determine which call has completed execution.

SPECIAL CONSIDERATIONS
If you call the OTInetStringToAddress function asynchronously, do not write to the InetHostInfo structure until the function completes.

COMPLETION EVENT CODES
T_DNRSTRINGTOADDRCOMPLETE0x10000001The OTInetStringToAddress function has completed.
SEE ALSO
The OTLookupName function (page 8-19) provides a mapper interface to the domain name resolver (DNR) that maps a name to a single internet address.

You can use the DNSAddress structure (page 8-23) to provide a domain name directly to the OTConnect, OTSndUData, and OTResolveAddress functions. The OTConnect, OTSndUData, and OTResolveAddress functions are described in the chapter "Endpoints" in this book.

Use the OTInetAddressToName function (described next) to convert an IP address into a domain name.

The InetHostInfo structure is described in "Internet Host Information Structure" on page 8-26.

You can use the OTInetHostToString function (page 8-55) to convert addresses in InetHost format into character strings using dotted-decimal notation.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996